package com.heimo.agentlicence.ui.adaptor;

import java.util.ArrayList;
import java.util.List;

import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentPagerAdapter;

import com.heimo.agentlicence.ui.fragment.BasicFragment;
import com.heimo.agentlicence.ui.fragment.CheckDisciplineFragment;
import com.heimo.agentlicence.ui.fragment.CheckLicenceFragment;

public class ScreenSlidePagerAdapter extends FragmentPagerAdapter {
    private List<BasicFragment> fragments;
	
	public ScreenSlidePagerAdapter(FragmentActivity ctx) {
        super(ctx.getSupportFragmentManager());
        this.fragments = new ArrayList<BasicFragment>();

        fragments.add(CheckLicenceFragment.newInstance(ctx,this));
        fragments.add(CheckDisciplineFragment.newInstance(ctx,this));
//        fragments.add(CheckDisciplineWebFragment.newInstance(ctx,this));
    }

	@Override
    public BasicFragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }
    
    public void updateLicence(String licenceNo){
    	for(int i =0;i<fragments.size();i++){
    		fragments.get(i).updateLicence(licenceNo);
    	}
    }
}